import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    token: '',
    userInfo: null
  },
  mutations: {
    setToken(state, data) {
      state.token = data
      localStorage.setItem('token', data)
    },
    setUserInfo(state, data) {
      state.userInfo = data
      localStorage.setItem('userInfo',JSON.stringify(data))
    }
  },
  actions: {

  }
})
